<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>辅导答疑平台-首页</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/common.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/popper.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous">
    </script>
    <style>
        .row {
            padding: 30px;
        }

        .question-title {
            margin-top: 10px;
        }

        .text-desc {
            font-size: 12px;
            color: #999;
            font-weight: normal;
        }
    </style>
</head>

<body style="background-color: #efefef;">
<div th:insert="template::header"></div>
<div class="container-fluid bg-secondary">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="background-color: white;">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4 class="question-title">
                    <span th:text="${question.title}"></span>
                </h4>
                <span class="text-desc">
                        作者：<span th:text="${question.name}"></span> |
                        发布时间：<span th:text="${#dates.format(question.createTime, 'yyyy-MM-dd HH:mm')}"></span> |
                        阅读数： <span>5</span>
                    </span>
                <hr/>
                <div th:utext="${question.content}">

                </div>
                <hr/>
                <span class="label label-default" style="background-color: #99CFFD;"
                      th:switch="${question.subject}"><span th:case="1">语文</span><span th:case="2">数学</span><span
                        th:case="3">英语</span><span th:case="4">编程</span></span>
                <hr/>
                <div>
                    <h4>
                        <span>0</span> 个答疑
                    </h4>
                    <hr/>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 comments">
                        <div class="media">
                            <div class="media-left">
                                <a href="#">
                                    <img class="media-object img-rounded" style="width:38px;height: 38px;"
                                         src="https://avatars1.githubusercontent.com/u/58406431?v=4">
                                </a>
                            </div>
                            <div class="media-body" id="comment-body-3538">
                                <h5 class="media-heading">
                                    <span></span>
                                </h5>
                                <div>测试一下测试一下测试一下测试一下测试一下测试一下</div>
                                <div class="menu">
                                    <span class="pull-right">2020-10-18</span>
                                </div>
                            </div>
                        </div>
                        <hr/>
                        <div class="media">
                            <div class="media-left">
                                <a href="#">
                                    <img class="media-object img-rounded" style="width:38px;height: 38px;"
                                         src="https://avatars1.githubusercontent.com/u/58406431?v=4">
                                </a>
                            </div>
                            <div class="media-body" id="comment-body-3538">
                                <h5 class="media-heading">
                                    <span></span>
                                </h5>
                                <div>测试一下测试一下测试一下测试一下测试一下测试一下</div>
                                <div class="menu">
                                    <span class="pull-right">2020-10-18</span>
                                </div>
                            </div>
                        </div>
                        <div class="media">
                            <div class="media-left">
                                <a href="#">
                                    <img class="media-object img-rounded" style="width:38px;height: 38px;"
                                         src="https://avatars1.githubusercontent.com/u/58406431?v=4">
                                </a>
                            </div>
                            <div class="media-body" id="comment-body-3538">
                                <h5 class="media-heading">
                                    <span></span>
                                </h5>
                                <div>测试一下测试一下测试一下测试一下测试一下测试一下</div>
                                <div class="menu">
                                    <span class="pull-right">2020-10-18</span>
                                </div>
                            </div>
                        </div>
                        <div class="media">
                            <div class="media-left">
                                <a href="#">
                                    <img class="media-object img-rounded" style="width:38px;height: 38px;"
                                         src="https://avatars1.githubusercontent.com/u/58406431?v=4">
                                </a>
                            </div>
                            <div class="media-body" id="comment-body-3538">
                                <h5 class="media-heading">
                                    <span></span>
                                </h5>
                                <div>测试一下测试一下测试一下测试一下测试一下测试一下</div>
                                <div class="menu">
                                    <span class="pull-right">2020-10-18</span>
                                </div>
                            </div>
                            <hr/>
                        </div>
                    </div>
                </div>
                <h4>
                    <span>提交回复</span>
                </h4>
                <div th:if="${session.user!=null}">
                    <div class="media">
                        <!--                    <div class="media-left">-->
                        <!--                        <a href="#">-->
                        <!--                            <img class="media-object img-rounded" th:src="@{(src=${session.user.ge})}" src="/images/default-avatar.png">-->
                        <!--                        </a>-->
                        <!--                    </div>-->
                        <div class="media-body">
                            <h5 class="media-heading">
                                <span th:text="${session.user.name}"></span>
                            </h5>
                        </div>
                    </div>
                    <form action="#" method="post" id="question">
                        <textarea id="mytextarea" name="comment" placeholder="请输入问题内容"></textarea>
                        <input type="text" value="1" style="display: none" name="name">
                        <span class="alert alert-danger" style="margin-top: 5px; display:none" id="warn" role="alert">
                        </span>
                        <input type="button" class="btn btn-default pull-right" value="提交" id="submit"
                               style="margin-top: 5px;">
                    </form>
                </div>
                <div th:if="${session.user==null}" style="margin-bottom: 20px">
                    请先<a th:href="@{'/login?backUrl='+${backUrl}}">登录</a>!
                </div>
            </div>

        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 bg-info">

        </div>
    </div>
</div>
<div th:insert="template::footer"></div>
<script src="/js/tinymce/tinymce.min.js"></script>
<script>
    tinymce.init({
        selector: '#mytextarea',
        language: 'zh_CN',
        height: 250
    });
</script>
</body>

</html>